package entity;

import org.springframework.util.StringUtils;

/**
 * @author duzhou
 * @version 2020/9/17
 */
public class FizzBuzzGame {

    private int order;

    public FizzBuzzGame(int order) {
        this.order = order;
    }

    public String report() {
        // 场景一：包含3
        String orderStr = String.valueOf(order);
        if (orderStr.contains("3")) {
            return "Fizz";
        }

        // 场景二：不包含3
        String result = "";

        if (order % 3 == 0) {
            result += "Fizz";
        }
        if (order % 5 == 0) {
            result += "Buzz";
        }
        if (order % 7 == 0) {
            result += "Whizz";
        }

        return result.isEmpty() ? orderStr : result;
    }
}
